home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / libs / sphigs / sph_srgp.lha / srgp / examples / README < prev    next >
Encoding:
Text File  |  1992-01-09  |  5.6 KB  |  130 lines

  1. UNIX platform users: 
  2. Please read the Makefile for information on building executables for SRGP
  3. applications.
  4.  
  5. Mac platform users: See the MacSRGP_README file.
  6.  
  7. Here are brief descriptions of some of the test applications.
  8.  
  9.  
  10.    -------------------------------------------------------------------------
  11.             X_demo_anim *or* MAC_demo_anim
  12.  
  13. This is the very same program that was shown in the Addison-Wesley booth at
  14. SIGGRAPH.  A nice way to become familiar with SRGP's basic functionality and
  15. see what SRGP application source code looks like.  The Mac version creates a
  16. window that fits on the MacII; the X version assumes the availability of much
  17. more screen real estate.  If you are using a Mac Plus or Mac SE, this demo is
  18. not of much use at all; much of the action will be off-screen.
  19.  
  20.    -------------------------------------------------------------------------
  21.                  test_locator
  22.  
  23. This program places the keyboard in RAW EVENT mode, and continuously displays
  24. the deluxe locator measure.  It is an excellent way to get to know SRGP's
  25. locator.  If it looks like the modifier chord and timestamp aren't working, you
  26. may want to re-read the reference manual's section on input carefully; they are
  27. supposed to reflect conditions as of the most recent mouse-button state change.
  28.  
  29. You use the keyboard to control the locator's mode:
  30.     i -- inactive
  31.     s -- sample (display is updated 3 times a second)
  32.     e -- event
  33.  
  34. You also use the keyboard to control the echo attribute:
  35.     c -- cursor
  36.     l -- rubber line
  37.     r -- rubber rect
  38.  
  39. You can control the button mask in this way:
  40.     1 -- toggles the status of the LEFT button in the button mask
  41.          ... etc. ...   for 2 (MIDDLE) and 3 (RIGHT)
  42.  
  43. You quit by typing:
  44.      q -- QUIT
  45.  
  46.    -------------------------------------------------------------------------
  47.                          test_keyboard
  48.  
  49. Tests keyboard in RAW EVENT mode only.  Each time you hit a key, a display
  50. of the deluxe keyboard measure's fields is updated.
  51.  
  52.    -------------------------------------------------------------------------
  53.                       testcolor_and_resize  
  54.  
  55. For 8-bit-deep framebuffer support only.  Creates a lovely, relaxing image of
  56. red fading into blue.  A vertical bisecting line and a horizontal bisecting
  57. line are then XOR'd over the image to divide the window into four quadrants.
  58. When you resize the window, the image is redrawn and the bisectors 
  59. recalculated and redrawn.  The code shows how to use SRGP's resize callback
  60. and how to load the SRGP color table.
  61.  
  62.    -------------------------------------------------------------------------
  63.              show_patterns *or* MAC_show_patterns
  64.  
  65. Simply displays all the built-in patterns and their corresponding indices.  The
  66. MAC one assumes the screen real estate of a Mac II, and thus goes off the edge
  67. on a Plus/SE.
  68.  
  69.  
  70.    -------------------------------------------------------------------------
  71.                   testrubber
  72.  
  73. The left mouse button adds a new line to the screen.  The right mouse button
  74. just changes the current anchor point.  Entering a 'Q' on the keyboard quits.
  75.  
  76.    -------------------------------------------------------------------------
  77.                   testpixmap
  78.  
  79. A poorly named demo, because it does a bit (no pun intended) more than that.
  80. It loads a pixmap from a file and fills an oval with it.  Press down the mouse
  81. button to see it load two identical bitmaps from a file and fill again.
  82. Release the mouse button to see the result of a change in foreground color and
  83. bitmap pattern index.  One more click terminates the demo.  WARNING: CANNOT BE
  84. RUN ON THE Mac -- MacSRGP does not yet support pixmaps.
  85.  
  86.    -------------------------------------------------------------------------
  87.                    testpaint
  88.  
  89. Each mouse button paints a different primary color.  Holding down more than one
  90. mouse button produces a "blend" of primary colors.  Basically shows the use of
  91. the locator in sample mode, which in this version of SRGP is not blazingly
  92. fast.  (NOTE: works even on monochrome screens, because of its use of patterns
  93. as a secondary attribute.)
  94. To exit, issue an interrupt from the UNIX shell or (on Mac) click in close box.
  95.  
  96.    -------------------------------------------------------------------------
  97.                    testeditkeyboard
  98.  
  99. Shows the use of the keyboard in edit mode.  You are asked to enter first a
  100. number, than a string.  The first "number" characters in the string you enter
  101. will be echoed.  To get the full effect, using the backspace key to correct
  102. typos as you use the keyboard to enter information.  
  103. To exit, issue an interrupt from the UNIX shell or (on Mac) click in close box.
  104.  
  105.    -------------------------------------------------------------------------
  106.                  testtimestamp
  107.  
  108. Each time you click the left mouse button, the current SRGP timestamp value is
  109. printed.  Much ado about nothing.  
  110. To exit, issue an interrupt from the UNIX shell or (on Mac) click in close box.
  111.  
  112.    -------------------------------------------------------------------------
  113.                      flynn
  114.  
  115. Here's another short SRGP demo.  It illustrates the copyPixel procedure by
  116. filling a window (resizable) with random colors picked from a 4x4x4 color cube,
  117. allowing the user to select a subrectangle with the mouse, and then 'dragging'
  118. the selected region around the screen so that it follows the mouse.  copyPixel
  119. is used to repair the damage.  When you resize the window, you have to select a
  120. new rectangle to drag.
  121.  
  122. The nice thing about this demo is that you can use it as a springboard for a
  123. student assignment.  In the code as written, there's a lot of unnecessary work
  124. in the damage repair.  The calls to copyPixel can be optimized to only repair
  125. the part that won't be obscured by the next `overlay' of the region being
  126. dragged around.
  127.  
  128. regards
  129. Pat Flynn (uunet!shillelagh.cse.nd.edu!flynn)
  130.